﻿@model BskLeague.Models.Player

@{
    ViewBag.Title = "Edycja profilu";
}

@Html.Partial("_Submenu")

<h3>Edycja profilu</h3>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Index", "MyPlayer", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)

        @Html.HiddenFor(model => model.PlayerId)
        @Html.HiddenFor(model => model.Email)
        @Html.HiddenFor(model => model.LicenceId)

        <div class="editor-label">
            @Html.LabelFor(model => model.PlayerName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PlayerName)
            @Html.ValidationMessageFor(model => model.PlayerName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PlayerSurname)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PlayerSurname)
            @Html.ValidationMessageFor(model => model.PlayerSurname)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Height)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Height)
            @Html.ValidationMessageFor(model => model.Height)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Weight)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Weight)
            @Html.ValidationMessageFor(model => model.Weight)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PlayerNumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PlayerNumber)
            @Html.ValidationMessageFor(model => model.PlayerNumber)
        </div>


        <div class="editor-label">
            @Html.LabelFor(model => model.About)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.About, 5, 40, null)
            @Html.ValidationMessageFor(model => model.About)
        </div>

        <div class="editor-label">
            @Html.HiddenFor(model => model.UserName)
        </div>
    
        <div>
            @Html.HiddenFor(model => model.Photo)
        </div>

        if (Model.Photo != null)
        {
            string url = Url.Content(Model.Photo);
            
            <div><img height="200" width="200" src= "@url" alt="IMAGES" /></div>
        }
    
        <input type="file" name="file" /> <br />
        <input type="submit" value="Zapisz zmiany" />
}
